﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="AddVolunteer.ascx.cs" Inherits="AddVolunteer" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>


<asp:HiddenField ID="hfVolunteerId" runat="server" />

<asp:Wizard ID="wzAddVolunteer" 
    runat="server" 
    DisplayCancelButton="true"
    CancelButtonText="Finish"
    StepNextButtonText="Next"
    StepPreviousButtonText="Back"
    OnFinishButtonClick="wzAddVolunteer_FinishButtonClick"
    onnextbuttonclick="wzAddVolunteer_NextButtonClick" 
    onpreviousbuttonclick="wzAddVolunteer_PreviousButtonClick" 
    onsidebarbuttonclick="wzAddVolunteer_SideBarButtonClick" 
    oncancelbuttonclick="wzAddVolunteer_CancelButtonClick">
    <StartNavigationTemplate>
        <asp:Button ID="btnAddVolunteer" runat="server" Text="Add Volunteer" CommandName="MoveNext" />
    </StartNavigationTemplate>
    <FinishNavigationTemplate>
        <asp:Button ID="btnMovePrevious" runat="server" Text="Back" CommandName="MovePrevious" />
        <asp:Button ID="btnFinish" runat="server" Text="Finish" CommandName="MoveComplete" />
    </FinishNavigationTemplate>
    <WizardSteps>
        <asp:WizardStep ID="wzAddVolunteerStep1" runat="server" Title="Name" AllowReturn="false">
            <table style="width: 100%;">
                <tr>
                    <td>Date Joined</td>
                    <td>
                        <asp:TextBox ID="tbDateJoined" runat="server" MaxLength="10" Columns="10"></asp:TextBox>
                        <cc1:CalendarExtender ID="ceDateJoined"
                            TargetControlID="tbDateJoined"
                            PopupPosition="BottomLeft"
                            Animated="true"
                            Format="MM/dd/yyyy"
                            runat="server">
                            </cc1:CalendarExtender>
                    </td>
                    <td>
                        <asp:RequiredFieldValidator 
                            ID="rfvDateJoined" 
                            runat="server" 
                            ControlToValidate="tbDateJoined"
                            ErrorMessage="Date Joined Required">*
                            </asp:RequiredFieldValidator>
                        <asp:RegularExpressionValidator 
                            ID="revDateJoined" 
                            runat="server" 
                            ErrorMessage="Invalid Date"
                            ControlToValidate="tbDateJoined"
                            ValidationExpression="^[0-1][0-9]/[0-3][0-9]/[1-2][90][0-9][0-9]$">*
                            </asp:RegularExpressionValidator>
                    </td>
                </tr>
                <tr>
                    <td>First Name</td>
                    <td>
                        <asp:TextBox 
                            ID="tbFirstName" 
                            runat="server" 
                            Columns="15" 
                            MaxLength="50"></asp:TextBox>
                    </td>
                    <td>
                        <asp:RequiredFieldValidator 
                            ID="rfvFirstName" 
                            runat="server"
                            ControlToValidate="tbFirstName"
                            ErrorMessage="First Name Required">*
                            </asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td>Last Name</td>
                    <td>
                        <asp:TextBox 
                            ID="tbLastName" 
                            runat="server" 
                            Columns="15" 
                            MaxLength="50">
                            </asp:TextBox>
                    </td>
                    <td>
                        <asp:RequiredFieldValidator 
                            ID="rfvLastName" 
                            runat="server"
                            ControlToValidate="tbLastName"
                            ErrorMessage="Last Name Required">*
                            </asp:RequiredFieldValidator>
                    </td>
                </tr>
            </table>
        </asp:WizardStep>
        <asp:WizardStep ID="wzAddVolunteerStep2" runat="server" Title="Demographics">
            <table style="width: 100%;">
                <tr>
                    <td>Gender</td>
                    <td colspan="2">
                        <asp:DropDownList ID="ddlGender" runat="server">
                            <asp:ListItem Text="Male" Value="M"></asp:ListItem>
                            <asp:ListItem Text="Female" Value="F"></asp:ListItem>
                        </asp:DropDownList>
                    </td>
                    <td>
                    </td>
                </tr>
                <tr>
                    <td>Age</td>
                    <td>
                        <asp:UpdatePanel ID="upAge" runat="server" RenderMode="Inline">
                            <ContentTemplate>
                                <asp:TextBox 
                                    ID="tbAge" 
                                    runat="server" 
                                    Columns="3" 
                                    MaxLength="3" 
                                    AutoPostBack="true" 
                                    OnTextChanged="tbAge_TextChanged"></asp:TextBox>
                            </ContentTemplate>
                            <Triggers>
                                <asp:AsyncPostBackTrigger ControlID="tbDOB" EventName="TextChanged" />
                            </Triggers>
                        </asp:UpdatePanel>
                    </td>
                    <td>
                        <asp:UpdatePanel ID="upDOB" runat="server" RenderMode="Inline">
                            <ContentTemplate>
                                Birthday
                                <asp:TextBox 
                                    ID="tbDOB" 
                                    runat="server" 
                                    MaxLength="10" 
                                    Columns="10" 
                                    AutoPostBack="true" 
                                    OnTextChanged="tbDOB_TextChanged"></asp:TextBox>
                                <cc1:CalendarExtender ID="ceDOB"
                                    TargetControlID="tbDOB"
                                    PopupPosition="BottomLeft"
                                    Animated="true"
                                    Format="MM/dd/yyyy"
                                    runat="server">
                                </cc1:CalendarExtender>
                            </ContentTemplate>
                            <Triggers>
                                <asp:AsyncPostBackTrigger ControlID="tbAge" EventName="TextChanged" />
                            </Triggers>
                        </asp:UpdatePanel>
                    </td>
                    <td>
                        <asp:RequiredFieldValidator 
                            ID="rfvDOB" 
                            runat="server" 
                            ControlToValidate="tbDOB"
                            ErrorMessage="Birthday Required">*
                            </asp:RequiredFieldValidator>
                        <asp:RegularExpressionValidator 
                            ID="revDOB" 
                            runat="server" 
                            ErrorMessage="Invalid Date"
                            ControlToValidate="tbDOB"
                            ValidationExpression="^[0-1][0-9]/[0-3][0-9]/[1-2][90][0-9][0-9]$">*
                            </asp:RegularExpressionValidator>
                    </td>
                </tr>
                <tr>
                    <td>Ethnicity</td>
                    <td colspan="2">
                        <asp:DropDownList ID="ddlEthnicity" runat="server">
                            <asp:ListItem></asp:ListItem>
                            <asp:ListItem>White - Non-Hispanic</asp:ListItem>
                            <asp:ListItem>White - Hispanic</asp:ListItem>
                            <asp:ListItem>American Indian</asp:ListItem>
                            <asp:ListItem>Asian</asp:ListItem>
                            <asp:ListItem>African American</asp:ListItem>
                            <asp:ListItem>Hawaiian or Pacific Islander</asp:ListItem>
                            <asp:ListItem>Multi-racial</asp:ListItem>
                            <asp:ListItem>Other</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                    <td>
                        <asp:RequiredFieldValidator 
                            ID="rfvEthnicity" 
                            runat="server"
                            ControlToValidate="ddlEthnicity"
                            ErrorMessage="Ethnicity Required">*
                            </asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td>Disability</td>
                    <td>
                        <asp:DropDownList ID="ddlDisabled" runat="server">
                            <asp:ListItem Text="Not Disabled" Value="false"></asp:ListItem>
                            <asp:ListItem Text="Is Disabled" Value="true"></asp:ListItem>
                        </asp:DropDownList>
                    </td>
                    <td>
                        Limitations
                        <asp:TextBox 
                            ID="tbLimitations" 
                            runat="server" 
                            Columns="30" 
                            MaxLength="255"></asp:TextBox>
                    </td>
                    <td>
                    </td>
                </tr>
            </table>
        </asp:WizardStep>
        <asp:WizardStep ID="wzAddVolunteerStep3" runat="server" Title="School">
            <table style="width: 100%;">
                <tr>
                    <td>Grade Level</td>
                    <td>
                        <asp:DropDownList ID="ddlGradeLevel" runat="server">
                            <asp:ListItem Text="" Value=""></asp:ListItem>
                            <asp:ListItem Text="12th" Value="1"></asp:ListItem>
                            <asp:ListItem Text="11th" Value="2"></asp:ListItem>
                            <asp:ListItem Text="10th" Value="3"></asp:ListItem>
                            <asp:ListItem Text="9th" Value="4"></asp:ListItem>
                            <asp:ListItem Text="8th" Value="5"></asp:ListItem>
                            <asp:ListItem Text="7th" Value="6"></asp:ListItem>
                            <asp:ListItem Text="6th" Value="7"></asp:ListItem>
                            <asp:ListItem Text="5th" Value="8"></asp:ListItem>
                            <asp:ListItem Text="4th" Value="9"></asp:ListItem>
                            <asp:ListItem Text="3rd" Value="10"></asp:ListItem>
                            <asp:ListItem Text="2nd" Value="11"></asp:ListItem>
                            <asp:ListItem Text="1st" Value="12"></asp:ListItem>
                            <asp:ListItem Text="Kindergarten" Value="13"></asp:ListItem>
                            <asp:ListItem Text="Graduated" Value="0"></asp:ListItem>
                        </asp:DropDownList>
                    </td>
                    <td>
                        Graduation Month
                        <asp:DropDownList ID="ddlGradMonth" runat="server">
                            <asp:ListItem Text="January" Value="1"></asp:ListItem>
                            <asp:ListItem Text="February" Value="2"></asp:ListItem>
                            <asp:ListItem Text="March" Value="3"></asp:ListItem>
                            <asp:ListItem Text="April" Value="4"></asp:ListItem>
                            <asp:ListItem Text="May" Value="5"></asp:ListItem>
                            <asp:ListItem Text="June" Value="6" Selected="True"></asp:ListItem>
                            <asp:ListItem Text="July" Value="7"></asp:ListItem>
                            <asp:ListItem Text="August" Value="8"></asp:ListItem>
                            <asp:ListItem Text="September" Value="9"></asp:ListItem>
                            <asp:ListItem Text="October" Value="10"></asp:ListItem>
                            <asp:ListItem Text="November" Value="11"></asp:ListItem>
                            <asp:ListItem Text="December" Value="12"></asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td>School</td>
                    <td>
                        <asp:LinqDataSource 
                            ID="ldsSchools" 
                            runat="server"
                            ContextTypeName="YDAT.YdatDB.YDATDataContext"
                            TableName="Schools"
                            Select="new (name, schoolId)"
                            OrderBy="name">
                            </asp:LinqDataSource>
                        <asp:DropDownList 
                            ID="ddlSchool" 
                            runat="server"
                            DataSourceID="ldsSchools"
                            DataTextField="name"
                            DataValueField="schoolId"
                            AppendDataBoundItems="true">   
                            <asp:ListItem></asp:ListItem>
                        </asp:DropDownList>
                    </td>
                    <td></td>
                </tr>
            </table>
        </asp:WizardStep>
        <asp:WizardStep ID="wzAddVolunteerStep4" runat="server" Title="Parent/Guardian">
            <asp:TextBox ID="TextBox4" runat="server"></asp:TextBox>
        </asp:WizardStep>
        <asp:WizardStep ID="wzAddVolunteerStep5" runat="server" Title="Contact Info">
            <table style="width: 100%;">
                <tr>
                    <td>Phone</td>
                    <td>
                        <asp:UpdatePanel ID="upPhoneNumbers" runat="server">
                            <ContentTemplate>
                                <asp:LinqDataSource 
                                    ID="ldsPhoneNumbers" 
                                    runat="server"
                                    ContextTypeName="YDAT.YdatDB.YDATDataContext"
                                    TableName="Volunteers"
                                    OnSelecting="ldsPhoneNumbers_Selecting">
                                </asp:LinqDataSource>
                                <asp:GridView ID="gv" 
                                    runat="server"
                                    DataSourceID="ldsPhoneNumbers">
                                </asp:GridView>
                               
                            </ContentTemplate>
                        </asp:UpdatePanel>
                    </td>
                </tr>
                <tr>
                    <td>Website</td>
                    <td>
                        <asp:TextBox ID="tbWebsite" runat="server" MaxLength="150" Columns="50"></asp:TextBox>
                    </td>
                </tr>
            </table>
        </asp:WizardStep>
        <asp:WizardStep ID="wzAddVolunteerStep6" runat="server" Title="Notes">
            <table style="width: 100%;">
                <tr>
                    <td>Allergies</td>
                    <td>
                        <asp:TextBox ID="tbAllergies" runat="server" MaxLength="255" Columns="50"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>Notes</td>
                    <td>
                        <asp:TextBox ID="tbNotes" runat="server" TextMode="MultiLine" Rows="4" Columns="40"></asp:TextBox>
                    </td>
                </tr>
            </table> 
            
        </asp:WizardStep>
    </WizardSteps>
</asp:Wizard>
<asp:ValidationSummary ID="ValidationSummary1" runat="server" ShowMessageBox="true" ShowSummary="false" />
